<%@ page language="java" pageEncoding="UTF-8"%>
<%@page contentType="text/html;charset=UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://v1.com/pn" prefix="v1" %>

<head>
<link  rel="stylesheet"  href="${baseurl}hezuoshe/css/shop.css" />
<link rel="stylesheet" type="text/css" href="${baseurl}hezuoshe/css/jquery.jqzoom.css" />
<script type="text/javascript" src="${baseurl}hezuoshe/js/jquery.jqzoom-core.js" ></script>
		
<script  type="text/javascript">
		$(document).ready(function(){
		
			/*
var n=2;
		 	var src=$(".img_list li img:first").attr("src");
			$(".img_show img").attr("src",src);
			$(".img_show a").attr("href",src);
*/
			$(".img_list li img:first").addClass("border");
							
			$(".img_list li img").click(function(){
						
						/*
src1=$(this).attr("src");
						$(".img_show img").attr("src",src1);
*/
						$(".img_list li img").removeClass("border");
						$(this).addClass("border");
 							
				});
				})
				
		$(document).ready(function(){  
    			var options = {
    			preloadImages: true,  
            		alwaysOn:false,  
            		zoomWidth: 300,  
            		zoomHeight: 300,
            		showEffect:'fadein',
            		hideEffect:'fadeout',
            		fadeinSpeed:'fast',
            		fadeoutSpeed:'fast'
    			}
    			$('.img_big').jqzoom(options);  
				
				}); 

function doComment(){
	if(isEmpty(document.getElementById("comment").value)){
		 alert("没有评论啊");
		 return;
	}

	document.getElementById("commentForm").submit();
}
var defaultTxts= new Array('卖家会和您联系的！QQ, mail, phone number...', '不要透露您的个人信息呀！');
function defaultTxt(txt, index){
	if(txt.value==defaultTxts[index]) {
		txt.value='';
	} else if(txt.value=='') {
		txt.value=defaultTxts[index];
	}
}
</script>
</head>
<body>
	
	<div class="container">
		<div class="col_left">
		<div class="col_top">
				<div class="img_show" align="center">
				<span>
				<a href="${item.url}" rel='gal1' class="img_big" >
				<img src="${item.url}"/></a></span></div>
			<div class="mark">
			<div class="description">
			<div class="caption" ><h4>商品信息</h4>${category.digest}</div>
			</div>
			<div class="share_product">
			<span>分享这件商品:</span>
			<!-- JiaThis Button BEGIN -->
<div id="ckepop">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div>


			</div>
			<div class="clear"></div>
			</div>
			<div class="img_list">
				<ul>
				<c:forEach items="${items}" var="it" varStatus="s">
				<li>	
					<a 
					<c:if test="${s.index==0}">class="zoomThumbActive"</c:if>
					href='javascript:void(0);' 
					rel="{gallery: 'gal1', smallimage: '${it.url}',largeimage: '${it.url}'}">
					<img src="${it.thumb}" height="100" /></a></li>
				</c:forEach>
				</ul>
			</div>
			<div class="clear"></div>
			
			<div class="shop_contact"><span>联系卖家: ( 您的个人信息将会被保护 )</span>
			<form action="./item.html?method.comment=" method="post" id="commentForm">
			<input type="hidden" id="itemid" name="itemid" value="${item.itemid}">
			<input type="hidden" id="categoryid" name="categoryid" value="${category.categoryid}">
			<div class="contact_form">
				<div>
				<label>您的联系方式:</label>
				</div>
				<div>
				<textarea id="contact" name="contact"  cols="30" rows="10" 
				onfocus="defaultTxt(this, 0)" onblur="defaultTxt(this, 0)"
				>卖家会和您联系的！QQ, mail, phone number...</textarea>
				</div>
			</div>
			<div class="contact_form">
			<div>
			<label><span> </span>卖家留言:</label><br/>
			<textarea id="comment" name="comment"  cols="30" rows="10"
			onfocus="defaultTxt(this, 1)" onblur="defaultTxt(this, 1)"
			>不要透露您的个人信息呀！</textarea>
			</div>
			<div>
			<input type="button" value="发送" onclick="doComment();"/>
			</div>
			</div>
			</form>
			</div>
			
			<c:forEach items="${comments}" var="it">
				<div class="comment_item">
					<span>
						评论：<c:out value="${it.comment}"></c:out><br /></span>
						<span style="color:#4272DB;"><c:out value="${empty it.visitor? '路人' : it.visitor}"></c:out></span>
				</div>
			</c:forEach>
			<v1:pn name="pageinfo" href="./category.html?categoryid=${category.categoryid}&itemid=${item.itemid}&page={0}"></v1:pn>
			
			<div id="col_btm">
				<c:import url="/common/interest.jsp"></c:import>
				<div class="clear"></div>
			</div>
		</div>
		
		<div class="clear"></div> 
	</div>
</body>
